import request from '@/utils/request'
import config from '@/utils/config'
import { splitStr } from '@/api/common'

//  财务管理 - 分页查询提现记录
export function cashList(params) {
  return request({
    url: config.BaseUrl + '/cash/record/page',
    method: 'get',
    params: splitStr(params)
  })
}
// 财务管理 - 分页查询提现记录中修改数据的接口
export function upDateCashRecorde(params) {
  return request({
    url: config.BaseUrl + '/auditOrRejectedCash',
    method: 'post',
    data: params
  })
}
// 财务管理 - 提现订单备注记录
export function checkRemark(id) {
  return request({
    url: config.BaseUrl + '/cash/remarks/record/' + id,
    method: 'get'
  })
}
// 财务管理 - 通过id获取信息
export function getUserMessage(id) {
  return request({
    url: config.BaseUrl + '/cash/record/' + id,
    method: 'get'
  })
}
// params: 1:课程提现;2:退佣金
// 财务管理 - 课程提现（退佣金）管理
export function teacherCashRecord(type, json) {
  if (json) {
    return request({
      url: config.BaseUrl + '/teacherCashRecord/page/' + type,
      method: 'get',
      params: splitStr(json)
    })
  } else {
    return request({
      url: config.BaseUrl + '/teacherCashRecord/page/' + type,
      method: 'get'
    })
  }
}
// 财务管理 - 更新课程提现（退佣金）
export function teacherCashRecordUpdate(params) {
  return request({
    url: config.BaseUrl + '/teacherCashRecord/update/',
    method: 'post',
    data: params
  })
}

// 飞象链-飞象链
export function findCashRecordList(params) {
  return request({
    url: config.BaseUrl + '/findCashRecordList',
    method: 'get',
    params
  })
}

// /cashRemarksRecord/findCashRemarksRecordList
export function findCashRemarksRecordList(params) {
  return request({
    url: config.BaseUrl + '/cashRemarksRecord/findCashRemarksRecordList',
    method: 'get',
    params
  })
}

// --  平台抽佣提现管理  --
// 分页查询平台抽佣提现申请
export function getPlatformCommissionList(params) {
  return request({
    url: config.BaseUrl + '/platformCommission/record/query/page',
    method: 'get',
    params
  })
}

// 平台抽佣提现申请记录详情
export function getPlatformCommissionRecord(params) {
  return request({
    url: config.BaseUrl + '/platformCommission/record/query',
    method: 'get',
    params
  })
}

// 驳回平台抽佣提现申请
export function reFusedPlatformCommissionRecord(params) {
  return request({
    url: config.BaseUrl + '/platformCommission/record/refused',
    method: 'post',
    data: params
  })
}

// 审核通过平台抽佣提现申请
export function passPlatformCommissionRecord(params) {
  return request({
    url: config.BaseUrl + '/platformCommission/record/review',
    method: 'post',
    data: params
  })
}

// 平台抽佣提现申请--已打款
export function loanedPlatformCommissionRecord(params) {
  return request({
    url: config.BaseUrl + '/platformCommission/record/loaned',
    method: 'post',
    data: params
  })
}

// 上传打款凭证
export function loanedVoucher(params) {
  return request({
    url: config.BaseUrl + '/platformCommission/record/loanedVoucher',
    method: 'post',
    data: params
  })
}

// 查看打款凭证
export function queryVoucher(params) {
  return request({
    url: config.BaseUrl + '/platformCommission/record/queryVoucher',
    method: 'get',
    params
  })
}

// 新增平台抽佣提现申请记录备注
export function addPlatremark(params) {
  return request({
    url: config.BaseUrl + '/platformCommission/record/remark/add',
    method: 'post',
    data: params
  })
}

// 查询指定提现申请记录备注列表
export function checkPlatremark(params) {
  return request({
    url: config.BaseUrl + '/platformCommission/record/remark/query/page',
    method: 'get',
    params
  })
}
